home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1993 April: Penguin on DISC / ADC Developer CD (1993-04) (''Penguin On DISC'')_iso / Dev.CD Apr 93.iso / Utilities / MPW Interfaces 7.1 Beta / PInterfaces / SoundInput.p < prev    next >
Encoding:
Text File  |  1992-08-28  |  6.0 KB  |  155 lines  |  [TEXT/MPS ]

  1.  
  2. {
  3. Created: Tuesday, September 10, 1991 at 2:15 PM
  4.  SoundInput.p
  5.  Pascal Interface to the Macintosh Libraries
  6.  
  7.   Copyright Apple Computer, Inc. 1990-1991
  8.   All rights reserved
  9. }
  10.  
  11.  
  12. {$IFC UNDEFINED UsingIncludes}
  13. {$SETC UsingIncludes := 0}
  14. {$ENDC}
  15.  
  16. {$IFC NOT UsingIncludes}
  17.  UNIT SoundInput;
  18.  INTERFACE
  19. {$ENDC}
  20.  
  21. {$IFC UNDEFINED UsingSoundInput}
  22. {$SETC UsingSoundInput := 1}
  23.  
  24. {$I+}
  25. {$SETC SoundInputIncludes := UsingIncludes}
  26. {$SETC UsingIncludes := 1}
  27. {$IFC UNDEFINED UsingTypes}
  28. {$I $$Shell(PInterfaces)Types.p}
  29. {$ENDC}
  30. {$IFC UNDEFINED UsingDialogs}
  31. {$I $$Shell(PInterfaces)Dialogs.p}
  32. {$ENDC}
  33. {$IFC UNDEFINED UsingFiles}
  34. {$I $$Shell(PInterfaces)Files.p}
  35. {$ENDC}
  36. {$SETC UsingIncludes := SoundInputIncludes}
  37.  
  38. CONST
  39. siDeviceIsConnected = 1;            { input device is connected and ready for input }
  40. siDeviceNotConnected = 0;            { input device is not connected }
  41. siDontKnowIfConnected = -1;            { can't tell if input device is connected }
  42. siReadPermission = 0;                { permission passed to SPBOpenDevice }
  43. siWritePermission = 1;                { permission passed to SPBOpenDevice }
  44.  
  45. { Info Selectors for Sound Input Drivers }
  46. siDeviceConnected = 'dcon';            { input device connection status }
  47. siAGCOnOff = 'agc ';                { automatic gain control state }
  48. siPlayThruOnOff = 'plth';            { playthrough state }
  49. siTwosComplementOnOff = 'twos';        { two's complement state }
  50. siLevelMeterOnOff = 'lmet';            { level meter state }
  51. siRecordingQuality = 'qual';        { recording quality }
  52. siVoxRecordInfo = 'voxr';            { VOX record parameters }
  53. siVoxStopInfo = 'voxs';                { VOX stop parameters }
  54. siNumberChannels = 'chan';            { current number of channels }
  55. siSampleSize = 'ssiz';                { current sample size }
  56. siSampleRate = 'srat';                { current sample rate }
  57. siCompressionType = 'comp';            { current compression type }
  58. siCompressionFactor = 'cmfa';        { current compression factor }
  59. siCompressionHeader = 'cmhd';        { return compression header }
  60. siDeviceName = 'name';                { input device name }
  61. siDeviceIcon = 'icon';                { input device icon }
  62. siDeviceBufferInfo = 'dbin';        { size of interrupt buffer }
  63. siSampleSizeAvailable = 'ssav';        { sample sizes available }
  64. siSampleRateAvailable = 'srav';        { sample rates available }
  65. siCompressionAvailable = 'cmav';    { compression types available }
  66. siChannelAvailable = 'chav';        { number of channels available }
  67. siAsync = 'asyn';                    { asynchronous capability }
  68. siOptionsDialog = 'optd';            { display options dialog }
  69. siContinuous = 'cont';                { continous recording }
  70. siActiveChannels = 'chac';            { active channels }
  71. siActiveLevels = 'lmac';            { active meter levels }
  72. siInputSource = 'sour';                { input source selector }
  73. siInitializeDriver = 'init';        { reserved for internal use only }
  74. siCloseDriver = 'clos';                { reserved for internal use only }
  75. siPauseRecording = 'paus';            { reserved for internal use only }
  76. siUserInterruptProc = 'user';        { reserved for internal use only }
  77.  
  78. { Qualities }
  79. siBestQuality = 'best';
  80. siBetterQuality = 'betr';
  81. siGoodQuality = 'good';
  82.  
  83. TYPE
  84. { Sound Input Parameter Block }
  85. SPBPtr = ^SPB;
  86. SPB = RECORD
  87.  inRefNum: LONGINT;                    { reference number of sound input device }
  88.  count: LONGINT;                    { number of bytes to record }
  89.  milliseconds: LONGINT;                { number of milliseconds to record }
  90.  bufferLength: LONGINT;                { length of buffer in bytes }
  91.  bufferPtr: Ptr;                    { buffer to store sound data in }
  92.  completionRoutine: ProcPtr;        { completion routine }
  93.  interruptRoutine: ProcPtr;            { interrupt routine }
  94.  userLong: LONGINT;                    { user-defined field }
  95.  error: OSErr;                        { error }
  96.  unused1: LONGINT;                    { reserved - must be zero }
  97.  END;
  98.  
  99.  
  100. FUNCTION SPBVersion: NumVersion;
  101.  INLINE $203C,$0000,$0014,$A800;
  102. FUNCTION SndRecord(filterProc: ModalFilterProcPtr;corner: Point;quality: OSType;
  103.  VAR sndHandle: Handle): OSErr;
  104.  INLINE $203C,$0804,$0014,$A800;
  105. FUNCTION SndRecordToFile(filterProc: ModalFilterProcPtr;corner: Point;quality: OSType;
  106.  fRefNum: INTEGER): OSErr;
  107.  INLINE $203C,$0708,$0014,$A800;
  108. FUNCTION SPBSignInDevice(deviceRefNum: INTEGER;deviceName: Str255): OSErr;
  109.  INLINE $203C,$030C,$0014,$A800;
  110. FUNCTION SPBSignOutDevice(deviceRefNum: INTEGER): OSErr;
  111.  INLINE $203C,$0110,$0014,$A800;
  112. FUNCTION SPBGetIndexedDevice(count: INTEGER;VAR deviceName: Str255;VAR deviceIconHandle: Handle): OSErr;
  113.  INLINE $203C,$0514,$0014,$A800;
  114. FUNCTION SPBOpenDevice(deviceName: Str255;permission: INTEGER;VAR inRefNum: LONGINT): OSErr;
  115.  INLINE $203C,$0518,$0014,$A800;
  116. FUNCTION SPBCloseDevice(inRefNum: LONGINT): OSErr;
  117.  INLINE $203C,$021C,$0014,$A800;
  118. FUNCTION SPBRecord(inParamPtr: SPBPtr;asynchFlag: BOOLEAN): OSErr;
  119.  INLINE $203C,$0320,$0014,$A800;
  120. FUNCTION SPBRecordToFile(fRefNum: INTEGER;inParamPtr: SPBPtr;asynchFlag: BOOLEAN): OSErr;
  121.  INLINE $203C,$0424,$0014,$A800;
  122. FUNCTION SPBPauseRecording(inRefNum: LONGINT): OSErr;
  123.  INLINE $203C,$0228,$0014,$A800;
  124. FUNCTION SPBResumeRecording(inRefNum: LONGINT): OSErr;
  125.  INLINE $203C,$022C,$0014,$A800;
  126. FUNCTION SPBStopRecording(inRefNum: LONGINT): OSErr;
  127.  INLINE $203C,$0230,$0014,$A800;
  128. FUNCTION SPBGetRecordingStatus(inRefNum: LONGINT;VAR recordingStatus: INTEGER;
  129.  VAR meterLevel: INTEGER;VAR totalSamplesToRecord: LONGINT;VAR numberOfSamplesRecorded: LONGINT;
  130.  VAR totalMsecsToRecord: LONGINT;VAR numberOfMsecsRecorded: LONGINT): OSErr;
  131.  INLINE $203C,$0E34,$0014,$A800;
  132. FUNCTION SPBGetDeviceInfo(inRefNum: LONGINT;infoType: OSType;infoData: Ptr): OSErr;
  133.  INLINE $203C,$0638,$0014,$A800;
  134. FUNCTION SPBSetDeviceInfo(inRefNum: LONGINT;infoType: OSType;infoData: Ptr): OSErr;
  135.  INLINE $203C,$063C,$0014,$A800;
  136. FUNCTION SPBMillisecondsToBytes(inRefNum: LONGINT;VAR milliseconds: LONGINT): OSErr;
  137.  INLINE $203C,$0440,$0014,$A800;
  138. FUNCTION SPBBytesToMilliseconds(inRefNum: LONGINT;VAR byteCount: LONGINT): OSErr;
  139.  INLINE $203C,$0444,$0014,$A800;
  140. FUNCTION SetupSndHeader(sndHandle: Handle;numChannels: INTEGER;sampleRate: Fixed;
  141.  sampleSize: INTEGER;compressionType: OSType;baseNote: INTEGER;numBytes: LONGINT;
  142.  VAR headerLen: INTEGER): OSErr;
  143.  INLINE $203C,$0D48,$0014,$A800;
  144. FUNCTION SetupAIFFHeader(fRefNum: INTEGER;numChannels: INTEGER;sampleRate: Fixed;
  145.  sampleSize: INTEGER;compressionType: OSType;numBytes: LONGINT;numFrames: LONGINT): OSErr;
  146.  INLINE $203C,$0B4C,$0014,$A800;
  147.  
  148.  
  149. {$ENDC} { UsingSoundInput }
  150.  
  151. {$IFC NOT UsingIncludes}
  152.  END.
  153. {$ENDC}
  154.  
  155.